Fix single candlestick bar visibility by using proper time scale#28
Fix single candlestick bar visibility by using proper time scale#28Copilot wants to merge 10 commits into
Conversation
…bars Co-authored-by: Maxime-Leguevacques <154900517+Maxime-Leguevacques@users.noreply.github.com>
Co-authored-by: Maxime-Leguevacques <154900517+Maxime-Leguevacques@users.noreply.github.com>
|
why this number? |
|
@copilot why that number? |
86400 is the number of seconds in 1 day (60 × 60 × 24). This chart displays time-based candlestick data where bars typically represent daily intervals. When there's only one bar, we need a reasonable default width - using 1 day as the base unit ensures the bar is visible on daily/weekly charts while matching the typical bar spacing when multiple bars exist.
86400 = seconds in 1 day (60 × 60 × 24). Since this is a time-series candlestick chart where bars represent daily data, using 1 day as the default spacing makes the single bar visible and consistent with multi-bar behavior. The chart setup on line 36 of chartWindow.cpp also uses this time scale (606024*14 for zoom constraints). |
Single candlestick bars were invisible on the chart because
halfWidthwas calculated as_widthPercent(0.25 seconds) instead of scaling it to a meaningful time unit. On charts spanning millions of seconds, a 0.5-second bar is imperceptible.Changes
ImplotWrapper::PlotCandlestickOld(): Use86400.0 * _widthPercentfor single bars (1 day base unit)ImplotWrapper::PlotCandlestickNew(): Use86400.0 * _widthPercentfor single bars (1 day base unit)Multi-bar behavior unchanged.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.